package com.gph.etrip;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;

import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
import android.widget.TextView;

import com.gph.etrip.R;

public class Tab extends TabActivity {
	/** Called when the activity is first created. */
	
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.tabmain);
		setTabs();
	}
	private void setTabs()
	{
		addTab("Home", R.drawable.tab_home, Home.class);
		addTab("Routes", R.drawable.tab_rewards, Category.class);
		addTab("Map", R.drawable.tab_info, ActivityMap.class);
		addTab("Search", R.drawable.tab_search, Search.class);
		//addTab("Test", R.drawable.home_normal, Test.class);
	}
	
	private void addTab(String labelId, int drawableId, Class c)
	{
		TabHost tabHost = getTabHost();
		Intent intent = new Intent(this, c);
		TabSpec spec = tabHost.newTabSpec("tab" + labelId);	
		
		spec.setIndicator(labelId, getResources().getDrawable(drawableId)).setContent(new Intent(this, c));
		
		tabHost.addTab(spec);
	}
}